# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V2.Model.DatafeedFetchSchedule do
  @moduledoc """
  The required fields vary based on the frequency of fetching. For a monthly fetch schedule, day_of_month and hour are required. For a weekly fetch schedule, weekday and hour are required. For a daily fetch schedule, only hour is required.

  ## Attributes

  *   `dayOfMonth` (*type:* `integer()`, *default:* `nil`) - The day of the month the feed file should be fetched (1-31).
  *   `fetchUrl` (*type:* `String.t`, *default:* `nil`) - The URL where the feed file can be fetched. Google Merchant Center will support automatic scheduled uploads using the HTTP, HTTPS, FTP, or SFTP protocols, so the value will need to be a valid link using one of those four protocols.
  *   `hour` (*type:* `integer()`, *default:* `nil`) - The hour of the day the feed file should be fetched (0-23).
  *   `minuteOfHour` (*type:* `integer()`, *default:* `nil`) - The minute of the hour the feed file should be fetched (0-59). Read-only.
  *   `password` (*type:* `String.t`, *default:* `nil`) - An optional password for fetch_url.
  *   `paused` (*type:* `boolean()`, *default:* `nil`) - Whether the scheduled fetch is paused or not.
  *   `timeZone` (*type:* `String.t`, *default:* `nil`) - Time zone used for schedule. UTC by default. E.g., "America/Los_Angeles".
  *   `username` (*type:* `String.t`, *default:* `nil`) - An optional user name for fetch_url.
  *   `weekday` (*type:* `String.t`, *default:* `nil`) - The day of the week the feed file should be fetched. Acceptable values are: - "`monday`" - "`tuesday`" - "`wednesday`" - "`thursday`" - "`friday`" - "`saturday`" - "`sunday`" 
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dayOfMonth => integer() | nil,
          :fetchUrl => String.t() | nil,
          :hour => integer() | nil,
          :minuteOfHour => integer() | nil,
          :password => String.t() | nil,
          :paused => boolean() | nil,
          :timeZone => String.t() | nil,
          :username => String.t() | nil,
          :weekday => String.t() | nil
        }

  field(:dayOfMonth)
  field(:fetchUrl)
  field(:hour)
  field(:minuteOfHour)
  field(:password)
  field(:paused)
  field(:timeZone)
  field(:username)
  field(:weekday)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V2.Model.DatafeedFetchSchedule do
  def decode(value, options) do
    GoogleApi.Content.V2.Model.DatafeedFetchSchedule.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V2.Model.DatafeedFetchSchedule do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
